1. The field of the invention
The present invention relates to a converting circuit for preventing wrong error correction code from occurring due to an error correction rule during data reading operation. More particularly, when the flash memory controller writes all 0xFF data into the flash memory, the byte error correction rule generates a set of correct error correction codes and the error correction code converting circuit converts the set of correct error correction codes into 0x FF error correction codes, and values stored in the data area and error correction code area of the flash memory are converted into 0xFF to prevent wrong error correction codes from occurring during data reading operation when the error correction codes are not completely 0xFF.
2. Description of related art
The flash memory is popular because of its advantageous characteristics, such as low power consumption, non-volatility, shock tolerance and high storage density. The flash memory has gradually replaced EEPROM or battery powered memory in majority portable devices. And the mature semiconductor technology allows further increased the storage density and transmission speed of the flash memory. Thus, the flash memory has successfully replaced the traditional storage media, such as the hard disk.
For maintaining completeness of the data stored in the flash memory, some manufacturers invented the error correction rule to calculate the value of the error correction code and the error correction rule corrects the bit when the bit error occurs. However, the conventional error correction rule in the flash memory is a single bit error correction rule, wherein the single bit error correction rule can judge whether a single or plurality of damaged bits exist when the micro processor demands data from the flash memory. If any single bit error occurs, the single bit error correction rule corrects the bit error. On the other hand, when a byte error occurs, the single bit error correction rule will report the error but however the single bit error correction rule cannot correct the byte error. For enabling the single bit error correction rule to correct the byte error, the byte error correction rule is necessary.
To apply the flash memory into the portable storage device, an erase command must be executed to convert the data area and the error correction code area of the flash memory into 0xFF, and if the single bit error correction rule is selected, both the data and the error correction codes are converted completely into 0xFF. Thus, there will be no occurrence of error in error correction codes during the subsequent data reading operation. But when the byte correction rule is selected and when the data is completely 0xFF and the error correction codes are not completely 0xFF, then the memory parity error will occur, or even worse, the data reading operation cannot be executed.
Therefore, it is highly desirable to prevent the wrong error correction codes from occurring due to the byte correction rule.